import request from '/@/utils/request';

// 查询商家抵扣券列表
export function listCoupon(query?: Object) {
  return request({
    url: '/module/mer/coupon/list',
    method: 'get',
    params: query
  })
}

// 查询商家抵扣券详细
export function getCoupon(id?: number) {
  return request({
    url: '/module/mer/coupon/' + id,
    method: 'get'
  })
}

// 新增商家抵扣券
export function addCoupon(data?: Object) {
  return request({
    url: '/module/mer/coupon',
    method: 'post',
    data: data
  })
}

// 修改商家抵扣券
export function updateCoupon(data?: Object) {
  return request({
    url: '/module/mer/coupon',
    method: 'put',
    data: data
  })
}

// 删除商家抵扣券
export function delCoupon(id?: number) {
  return request({
    url: '/module/mer/coupon/' + id,
    method: 'delete'
  })
}

// 导出商家抵扣券
export function exportCoupon(query?: Object) {
  return request({
    url: '/module/mer/coupon/export',
    method: 'get',
    params: query
  })
}
